/**
 * Copyright (c) 2008 Andrew Rapp. All rights reserved.
 *  
 * This file is part of XBee-API.
 *  
 * XBee-API is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * XBee-API is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with XBee-API.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.rapplogic.xbee.api;

import java.util.HashMap;
import java.util.Map;

import com.rapplogic.xbee.util.ByteUtils;

public class/*enum*/ ApiId {

    ApiId[] apiIds = new ApiId[]{};
    public static final ApiId TX_REQUEST_64 = new ApiId(0x0);
    public static final ApiId TX_REQUEST_16 = new ApiId(0x1);
    public static final ApiId AT_COMMAND = new ApiId(0x08);
    public static final ApiId AT_COMMAND_QUEUE = new ApiId(0x09);
    public static final ApiId ZNET_REMOTE_AT_REQUEST = new ApiId(0x17);
    public static final ApiId ZNET_TX_REQUEST = new ApiId(0x10);
    public static final ApiId ZNET_EXPLICIT_TX_REQUEST = new ApiId(0x11);
    public static final ApiId RX_64_RESPONSE = new ApiId(0x80);
    public static final ApiId RX_16_RESPONSE = new ApiId(0x81);
    public static final ApiId RX_64_IO_RESPONSE = new ApiId(0x82);
    public static final ApiId RX_16_IO_RESPONSE = new ApiId(0x83);
    public static final ApiId AT_RESPONSE = new ApiId(0x88);
    public static final ApiId TX_STATUS_RESPONSE = new ApiId(0x89);
    public static final ApiId MODEM_STATUS_RESPONSE = new ApiId(0x8a);
    public static final ApiId ZNET_RX_RESPONSE = new ApiId(0x90);
    public static final ApiId ZNET_EXPLICIT_RX_RESPONSE = new ApiId(0x91);
    public static final ApiId ZNET_TX_STATUS_RESPONSE = new ApiId(0x8b);
    public static final ApiId ZNET_REMOTE_AT_RESPONSE = new ApiId(0x97);
    public static final ApiId ZNET_IO_SAMPLE_RESPONSE = new ApiId(0x92);
    public static final ApiId ZNET_IO_NODE_IDENTIFIER_RESPONSE = new ApiId(0x95);
    public static final ApiId ERROR_RESPONSE = new ApiId(-1);
    private static final Map lookup = new HashMap();


    static {

        lookup.put(TX_REQUEST_64.getValue(), TX_REQUEST_64);
        lookup.put(TX_REQUEST_16.getValue(), TX_REQUEST_16);
        lookup.put(AT_COMMAND.getValue(), AT_COMMAND);
        lookup.put(AT_COMMAND_QUEUE.getValue(), AT_COMMAND_QUEUE);
        lookup.put(ZNET_REMOTE_AT_REQUEST.getValue(), ZNET_REMOTE_AT_REQUEST);
        lookup.put(ZNET_TX_REQUEST.getValue(), ZNET_TX_REQUEST);
        lookup.put(ZNET_EXPLICIT_TX_REQUEST.getValue(), ZNET_EXPLICIT_TX_REQUEST);
        lookup.put(RX_64_RESPONSE.getValue(), RX_64_RESPONSE);
        lookup.put(RX_16_RESPONSE.getValue(), RX_16_RESPONSE);
        lookup.put(RX_64_IO_RESPONSE.getValue(), RX_64_IO_RESPONSE);
        lookup.put(RX_16_IO_RESPONSE.getValue(), RX_16_IO_RESPONSE);
        lookup.put(AT_RESPONSE.getValue(), AT_RESPONSE);
        lookup.put(TX_STATUS_RESPONSE.getValue(), TX_STATUS_RESPONSE);
        lookup.put(MODEM_STATUS_RESPONSE.getValue(), MODEM_STATUS_RESPONSE);
        lookup.put(ZNET_RX_RESPONSE.getValue(), ZNET_RX_RESPONSE);
        lookup.put(ZNET_EXPLICIT_RX_RESPONSE.getValue(), ZNET_EXPLICIT_RX_RESPONSE);
        lookup.put(ZNET_TX_STATUS_RESPONSE.getValue(), ZNET_TX_STATUS_RESPONSE);
        lookup.put(ZNET_REMOTE_AT_RESPONSE.getValue(), ZNET_REMOTE_AT_RESPONSE);
        lookup.put(ZNET_IO_SAMPLE_RESPONSE.getValue(), ZNET_IO_SAMPLE_RESPONSE);
        lookup.put(ZNET_IO_NODE_IDENTIFIER_RESPONSE.getValue(), ZNET_IO_NODE_IDENTIFIER_RESPONSE);
        lookup.put(ERROR_RESPONSE.getValue(), ERROR_RESPONSE);

    }

    ApiId(int value) {
        this.value = value;
    }

    public static ApiId get(int value) {
        return (ApiId) lookup.get(new Integer(value));
    }
    private final int value;

    public Integer getValue() {
        return new Integer(value);
    }

    public String toString() {
        return "";
    }
}
